package com.lib.module_base.utils

import android.content.Context
import android.os.Vibrator
import android.view.View
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import androidx.appcompat.app.AppCompatActivity
class AnimUtil {
    fun shake(view: View,context: Context) {
        val shake: Animation = AnimationUtils.loadAnimation(context, com.lib.module_res.R.anim.shake) //加载动画资源文件
        val vibrator = context.getSystemService(AppCompatActivity.VIBRATOR_SERVICE) as Vibrator
        vibrator.vibrate(100)
        view.startAnimation(shake)
    }

}